package com.googlecode.mgwt.examples.uibinder.client;

import com.googlecode.mgwt.examples.uibinder.client.activities.ExampleDisplay;
import com.googlecode.mgwt.examples.uibinder.client.places.ExamplePlace;

public class DisplayMapper {

	private final ClientFactory clientFactory;

	public DisplayMapper(ClientFactory clientFactory) {
		this.clientFactory = clientFactory;

	}

	public ExampleDisplay getDisplay(ExamplePlace place) {

		switch (place.getId()) {
		case HEADER_PANEL:
			return clientFactory.getHeaderPanelDisplay();

		case BUTTON:
			return clientFactory.getButtonDisplay();
		case CELL_LIST:
			return clientFactory.getCellListDisplay();
		case INPUT:
			return clientFactory.getInputDisplay();
		case SLIDER:
			return clientFactory.getSliderDisplay();
		default:

			return null;

		}
	}
}
